home *** CD-ROM | disk | FTP | other *** search
/ OpenGL Superbible (2nd Edition) / OpenGL SuperBible e2.iso / tools / Mesa-3.0 / SRC / API.H < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-20  |  2.3 KB  |  101 lines

  1. /* $Id: api.h,v 3.3 1998/02/20 04:48:57 brianp Exp $ */
  2.  
  3. /*
  4.  * Mesa 3-D graphics library
  5.  * Version:  3.0
  6.  * Copyright (C) 1995-1998  Brian Paul
  7.  *
  8.  * This library is free software; you can redistribute it and/or
  9.  * modify it under the terms of the GNU Library General Public
  10.  * License as published by the Free Software Foundation; either
  11.  * version 2 of the License, or (at your option) any later version.
  12.  *
  13.  * This library is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16.  * Library General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU Library General Public
  19.  * License along with this library; if not, write to the Free
  20.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  */
  22.  
  23.  
  24. /*
  25.  * $Log: api.h,v $
  26.  * Revision 3.3  1998/02/20 04:48:57  brianp
  27.  * updated comments
  28.  *
  29.  * Revision 3.2  1998/02/04 00:44:02  brianp
  30.  * WIN32 patch from Oleg Letsinsky
  31.  *
  32.  * Revision 3.1  1998/02/04 00:14:18  brianp
  33.  * updated for Cygnus (Stephane Rehel)
  34.  *
  35.  * Revision 3.0  1998/01/31 20:41:55  brianp
  36.  * initial rev
  37.  *
  38.  */
  39.  
  40.  
  41. /*
  42.  * This header contains stuff only included by api1.c, api2.c and apiext.c
  43.  */
  44.  
  45.  
  46. #ifndef API_H
  47. #define API_H
  48.  
  49.  
  50. /*
  51.  * Single/multiple thread context selection.
  52.  */
  53. #ifdef THREADS
  54.  
  55. /* Get the context associated with the calling thread */
  56. #define GET_CONTEXT    GLcontext *CC = gl_get_thread_context()
  57.  
  58. #else
  59.  
  60. /* CC is a global pointer for all threads in the address space */
  61. #define GET_CONTEXT
  62.  
  63. #endif /* THREADS */
  64.  
  65.  
  66. /*
  67.  * Make sure there's a rendering context.
  68.  */
  69. #define CHECK_CONTEXT                            \
  70.    if (!CC) {                                \
  71.       if (getenv("MESA_DEBUG")) {                    \
  72.      fprintf(stderr,"Mesa user error: no rendering context.\n");    \
  73.       }                                    \
  74.       return;                                \
  75.    }
  76.  
  77. #define CHECK_CONTEXT_RETURN(R)                        \
  78.    if (!CC) {                                \
  79.       if (getenv("MESA_DEBUG")) {                    \
  80.          fprintf(stderr,"Mesa user error: no rendering context.\n");    \
  81.       }                                    \
  82.       return (R);                            \
  83.    }
  84.  
  85.  
  86. /*
  87.  * An optimization in a few performance-critical functions.
  88.  */
  89. #define SHORTCUT
  90.  
  91.  
  92. /*
  93.  * Windows 95/NT DLL stuff.
  94.  */
  95. #if !defined(WIN32) && !defined(WINDOWS_NT) && !defined(__CYGWIN32__)
  96. #define APIENTRY
  97. #endif
  98.  
  99.  
  100. #endif
  101.